project(appkit)

set(SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR})
add_library(${PROJECT_NAME} ${LIB_BUILD_TYPE}
    ${SRC_PATH}/application.cpp
    ${SRC_PATH}/async.cpp
    ${SRC_PATH}/basetype.cpp
    ${SRC_PATH}/console.cpp
    ${SRC_PATH}/coroutine.cpp
    ${SRC_PATH}/cppunit.cpp
    ${SRC_PATH}/datetime.cpp
    ${SRC_PATH}/fileio.cpp
    ${SRC_PATH}/fsm.cpp
    ${SRC_PATH}/ipc.cpp
    ${SRC_PATH}/logger.cpp
    ${SRC_PATH}/network.cpp
    ${SRC_PATH}/packet.cpp
    ${SRC_PATH}/pinctrl.cpp
    ${SRC_PATH}/pluglet.cpp
    ${SRC_PATH}/regex.cpp
    ${SRC_PATH}/serial.cpp
    ${SRC_PATH}/socket.cpp
    ${SRC_PATH}/spidev.cpp
    ${SRC_PATH}/strutil.cpp
    ${SRC_PATH}/system.cpp
    ${SRC_PATH}/thread.cpp
    ${SRC_PATH}/timer.cpp
    ${SRC_PATH}/tracer.cpp
)

# 有时候找不到文件系统库时可以手动添加库路径
link_directories(${PROJECT_NAME} PRIVATE
    ${SYSROOT_PATH}/usr/lib
)

target_link_libraries(${PROJECT_NAME} PRIVATE
    ${LIB_UUID}
    ${LIB_SYSTEM}
)

# 安装目标文件
install(TARGETS ${PROJECT_NAME}
    ARCHIVE DESTINATION ${INSTALL_LIB_PATH}
    LIBRARY DESTINATION ${INSTALL_LIB_PATH}
    RUNTIME DESTINATION ${INSTALL_BIN_PATH}
)
